<!DOCTYPE html>
<ba-card>
    <div class="cardIdeaPage">
        <div class="titleIdea"><span class="ideaDate">{{formateDate(idea.createdAt)}} </span>
            <h3 class="listIdeaTitle"><span (click)="sendNotification(idea)" class="cardTitle"> {{idea.title}}</span><span class="editIdeaList" *ngIf="idea.isOwner" (click)="ShowEditIdea(idea)"><i class="ion-edit"></i></span>
                <div class="dropdown_update" dropdown [dropdownToggle]="false">
                    <button class="ion-arrow-down-b shareonfacebook" type="button" dropdown-open></button>
                    <ul class="dropdown-menu  shareonfacebooklist ">
                        <li class="underln" (click)="sharewithFB(idea)">Share on facebook</li>
                        <li class="underln" *ngIf="idea.isOwner" (click)="deleteIdea(idea)">Delete Idea</li>
                    </ul>
                </div>
            </h3>
        </div>
        <div class="ideaBy">
            <p><span class="textCss">Author: </span> <span class="userName" (click)="viewProfile(idea)">{{idea.name}} </span></p>
        </div>
        <div [innerHTML]="idea.content" class="descriptionIdea containerheight">
        </div>
        <div *ngIf="!versioning">
            <div class="citationIdeaDiv"></div>
        </div>
        <!--<div *ngIf="versioning">
            <div class="citationIdea" *ngIf="idea.citation && idea.citation != 'undefined' && idea.citation.name!=='' && versioning">
                <p>
                    {{idea.citationArray}}</p>[{{idea.citation.showCount}}: {{idea.citation.name}}, {{formateDate(idea.citation.updatedAt).split(" ")[0]}}]
            </div>
        </div>-->
        <div class="listTags">
            <ul>
                <li *ngFor="let tags of idea.tags">{{tags?tags:''}}</li>
            </ul>
        </div>
        <div class="row row icons-list primary">
            <div class="col-md-12 ideaCardFooter likeDivMediaScreen">
                <!--todo 隐藏点赞以及踩-->
                <div class="col-md-2 ideaFooter likeDiv"><i class="ion-thumbsup chatbox" [ngClass]="{'likeClicked':idea.isliked}" (click)="likesCount(idea)"></i>
                    <!--{{idea.likes}}-->
                </div>
                <div class="col-md-2 ideaFooter dislikeDiv"><i class="ion-thumbsdown chatbox" [ngClass]="{'likeClicked':idea.isdisliked}" (click)="dislikesCount(idea)"></i>
                    <!--{{idea.dislikes}}-->
                </div>
                <div class="col-md-2 ideaFooter pointsDiv"><i class="ion-android-star chatbox"></i> {{idea.points}}</div>
                <div class="col-md-2 ideaFooter favorateDiv" [ngClass]="{'iFavourite': idea.isfavorite}"><i class="ion-heart heart" (click)="favouriteCount(idea)"></i></div>
                <div class="col-md-2 ideaFooter commentDiv" (click)="sendNotification(idea)"><i class="ion-chatboxes chatbox"></i> {{idea.commentcount}}
                </div>
                <div class="col-md-2 ideaFooter abuseDiv" [ngClass]="{'abusing': idea.isAbused, 'avoid-clicks':idea.isAbused}" (click)="setAbuse(idea);"><i class="ion-alert-circled"></i></div>
            </div>
        </div>
    </div>
</ba-card>
<div class="citationTreedialog">
    <modal #citationTree (onClose)="closeCitationTreeDialog()">
        <modal-header>
            <div id="tree-simple" style="width:100%; height: 100%;"></div>
        </modal-header>
    </modal>
</div>
<div class="citationTreedialogSingleKey">
    <modal #citationTreeSingleKey (onClose)="closeCitationTree()">
        <modal-header>
            <div id="tree-simple" style="width:100%; height: 100%;"></div>
        </modal-header>
    </modal>
</div>

<div class="userAbuseModelAdmin">
    <modal #ViewDetailIdeaModel (onClose)="refreshActivity()">
        <modal-header>
            <viewCardIdeaDetail (notifyParent)="getNotificationModal($event);" (notifyIdeaParent)="notifyToRefresh();" #viewCardIdeaDetail [viewDetailIdea]="viewDetailIdea" (notifyParenttoProfile)="notifyParenttoProfileModal($event)"></viewCardIdeaDetail>
        </modal-header>
    </modal>
</div>

<div class="reportAbuse">
    <modal #abuseModal modalClass="abuse-popup">
        <modal-header>
            <abuse [idea]="abuseIdea" (notifyAbuseModal)="getNotificationAbuseModal($event)"></abuse>
        </modal-header>
    </modal>
    <modal #deleteIdeaModal>
        <modal-header>
            <div class="deleteHeader"> Are you sure you want to delete this Idea? </div>
            <div class="col-md-12 deleteModalButtons">
                <button class="btn btn-default btn-auth ideaDeleteOk" (click)="deleteParticularIdea()">Ok</button>
                <button class="btn btn-default btn-auth ideaDeleteCancel" (click)="deleteIdeaModal.close()">Cancel</button>
            </div>
        </modal-header>
    </modal>

</div>
<script>
    $('.tag-input__text-input').on('focus', function() {
        var uiAutoBox = $('ng2-dropdown-menu');
        $(this).parent().append(uiAutoBox);
    });
</script>